﻿@{
    Layout = null;

}
<head>
    <title>添加权限</title>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui.admin/css/style.css" />
    <link href="~/css/img.css" rel="stylesheet" />
</head>
<body class="bb1">
    <div align=center class="d1">
        <marquee style="FONT-SIZE: 35pt; WIDTH: 400px; FILTER: shadow(color=#AF0530); LINE-HEIGHT:15pt; FONT-FAMILY: 隶书; HEIGHT: 80px" scrollamount=6>
            <h2 style="margin-top:0px;text-align:center"><font color=#f90b46>添加权限 </font></h2>
        </marquee>
    </div>

    <div >
        <article class="page-container">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3" style="position:relative;left:50px;line-height:30px;"><span class="c-red">*</span>父级权限：</label>
                <div class="formControls col-xs-8 col-sm-9" style="position:relative;left:-50px">
                    <select id="select1" class="select valid" name="adminRole" size="1" aria-required="true" aria-invalid="false">
                        @foreach (var a in Model)
                        {
                            <option value="@a.PermissionId">@a.PermissionName</option>
                        }

                    </select>
                </div>
            </div><br />
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3" style="position:relative;left:50px;line-height:30px;"><span class="c-red">*</span>权限名称：</label>
                <div class="formControls col-xs-8 col-sm-9" style="position:relative;left:-50px">
                    <input type="text" class="input-text" value="" placeholder="" id="PermissionName" name="PermissionName">
                </div>
            </div><br />
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3" style="position:relative;left:50px;line-height:30px;"><span class="c-red">*</span>权限路径：</label>
                <div class="formControls col-xs-8 col-sm-9" style="position:relative;left:-50px">
                    <input type="text" class="input-text" value="" placeholder="" id="PermissionUrl" name="singlenum">
                </div>
            </div><br />
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;保存&nbsp;&nbsp;" onclick="funStrategy()">
                    <input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;关闭&nbsp;&nbsp;" onclick="location.href='/Home/ShowPermission'">
                </div>
            </div>
        </article>
    </div>
    <footer class="footer mt-20">
        <div class="container">
            <p>
                关于我们  |  联系我们    |  项目合作  |  广告植入   |  友情链接<br />
                版权所有 京ICP备11009069<br />
                Copyright ©2016 Gaotie.cn
            </p>
        </div>
    </footer>
</body>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="~/H-ui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="~/H-ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="~/H-ui/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="~/H-ui/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="~/H-ui/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="~/H-ui/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="~/H-ui/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    function funStrategy() {
        var id = $("#select1").val();
        var name = $("#PermissionName").val();
        var url = $("#PermissionUrl").val();
        $.ajax({
            type: "post",
            url: "/Home/AddPermissionDo",
            data: { ParentId: id, PermissionName: name, PermissionUrl: url },
            success: function (obj) {
                if (obj) {
                    alert('添加成功');
                    return;
                }
                else {
                    alert('添加失败');
                    return;
                }
            }
        })
    }
</script> 